Conversation
|
@Ayaanshaikh12243 is attempting to deploy a commit to the Divya Tiwari's projects Team on Vercel. A member of the Team first needs to authorize it. |
✅ Deploy Preview for tiwaridivya25-devconnect ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
👋 Hi @Ayaanshaikh12243, Please link an issue using one of the following formats:
Linking issues helps us track work and close issues automatically. Thanks! 🙌 |
Thanks for creating a PR for your Issue!
|
|
@TiwariDivya25 please check mam thank you |
|
@Ayaanshaikh12243 Please follow the PR template and link the issue number in the given format. |
|
@TiwariDivya25 mam please share the template |
|
@TiwariDivya25 where is the template please share mam |
#174
// Before: 30 seconds (excessive)
const interval = setInterval(updatePresence, 30000);
// After: 2 minutes (optimized)
const interval = setInterval(updatePresence, 120000);
Copy
typescript
2. Connection Pooling Implemented:
// Shared channels instead of multiple connections
const messageChannels = new Map<number, any>();
const channelSubscribers = new Map<number, Set<() => void>>();
let sharedPresenceChannel: any = null;
Copy
typescript
3. Proper Cleanup:
// Clean up shared channel if no subscribers
if (presenceSubscribers.size === 0 && sharedPresenceChannel) {
supabase.removeChannel(sharedPresenceChannel);
sharedPresenceChannel = null;
}
Copy
typescript
4. Error Handling Added:
try {
await supabase.from('UserPresence').upsert({...});
} catch (error) {
console.warn('Failed to update presence:', error);
}
Copy
typescript
Performance Improvements:
75% less network requests (2 min vs 30 sec intervals)
Connection pooling prevents multiple channels
Memory leak prevention with proper cleanup
Error resilience with try-catch blocks
Issue #174 resolved! 🚀